package com.itheima.sh.exception;


import com.itheima.sh.response.StatusCode;

/**
 * @author win10
 */
public class BusinessException extends RuntimeException {

    /**
     * 保存错误信息统一响应
     */
    private final Integer code;
    private final String message;

    public BusinessException(String message) {
        this.code = StatusCode.ERROR.getCode();
        this.message = message;

    }

    public BusinessException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getMsg() {
        return message;
    }

    public Integer getCode() {
        return code;
    }

}
